package qq.listener;

import love.forte.common.ioc.annotation.Beans;
import love.forte.common.ioc.annotation.Depend;
import love.forte.simbot.bot.BotManager;
import love.forte.simbot.timer.Cron;
import love.forte.simbot.timer.EnableTimeTask;
import love.forte.simbot.timer.Fixed;
import qq.service.TianQiService;

import java.util.concurrent.TimeUnit;

@Beans
@EnableTimeTask
public class TimingListener {
    @Depend
    private BotManager botManager;

    @Cron("0 0 7 ? * *")
    public void morning(){
        String weather = TianQiService.INSTANCE.getWeather("湘潭");
        botManager.getDefaultBot().getSender().SENDER.sendGroupMsg("315070798",weather);
//        botManager.getDefaultBot().getSender().SENDER.sendGroupMsg("315070798",weather);
//        botManager.getDefaultBot().getSender().SENDER.sendGroupMsg("315070798","早安[CAT:image,url=http://c2cpicdw.qpic.cn/offpic_new/1030699086//1030699086-3091709661-B50D1116C8722D4D3040C3A4FEA8072A/0?term&#61;2]");
//        botManager.getDefaultBot().getSender().SENDER.sendGroupMsg("315070798","早安[CAT:image,id={B25F9AE0-423A-D119-7099-F8C1B091011B}.jpg,url=http://gchat.qpic.cn/gchatpic_new/1030699086/947940907-2197738266-B25F9AE0423AD1197099F8C1B091011B/0?term&#61;2]");
        return;
    }

    @Cron("0 0 23 ? * *")
    public void evening(){
        botManager.getDefaultBot().getSender().SENDER.sendGroupMsg("315070798","晚安[CAT:image,id={7608F7EC-71B6-D93B-0A69-4E4859FA3846}.jpg,url=http://gchat.qpic.cn/gchatpic_new/1030699086/947940907-2352202530-7608F7EC71B6D93B0A694E4859FA3846/0?term&#61;2]");
        botManager.getDefaultBot().getSender().SENDER.sendGroupMsg("315070798","晚安[CAT:image,id={7608F7EC-71B6-D93B-0A69-4E4859FA3846}.jpg,url=http://gchat.qpic.cn/gchatpic_new/1030699086/947940907-2352202530-7608F7EC71B6D93B0A694E4859FA3846/0?term&#61;2]");
    }

}
